package com.drm.netschool.mapper;

import com.drm.netschool.entity.SumerGroupExt;
import com.drm.netschool.entity.SumerGroupExtExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SumerGroupExtMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    int countByExample(SumerGroupExtExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    int deleteByExample(SumerGroupExtExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    @Delete({
        "delete from sumer_group_ext",
        "where group_id = #{groupId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long groupId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    @Insert({
        "insert into sumer_group_ext (group_id, view_cnt, ",
        "integral, merber_cnt, ",
        "topic_cnt, activity_cnt)",
        "values (#{groupId,jdbcType=BIGINT}, #{viewCnt,jdbcType=INTEGER}, ",
        "#{integral,jdbcType=INTEGER}, #{merberCnt,jdbcType=INTEGER}, ",
        "#{topicCnt,jdbcType=INTEGER}, #{activityCnt,jdbcType=INTEGER})"
    })
    int insert(SumerGroupExt record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    int insertSelective(SumerGroupExt record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    List<SumerGroupExt> selectByExample(SumerGroupExtExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    @Select({
        "select",
        "group_id, view_cnt, integral, merber_cnt, topic_cnt, activity_cnt",
        "from sumer_group_ext",
        "where group_id = #{groupId,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    SumerGroupExt selectByPrimaryKey(Long groupId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    int updateByExampleSelective(@Param("record") SumerGroupExt record, @Param("example") SumerGroupExtExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    int updateByExample(@Param("record") SumerGroupExt record, @Param("example") SumerGroupExtExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    int updateByPrimaryKeySelective(SumerGroupExt record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_group_ext
     *
     * @mbggenerated Sat Aug 01 12:55:27 CST 2015
     */
    @Update({
        "update sumer_group_ext",
        "set view_cnt = #{viewCnt,jdbcType=INTEGER},",
          "integral = #{integral,jdbcType=INTEGER},",
          "merber_cnt = #{merberCnt,jdbcType=INTEGER},",
          "topic_cnt = #{topicCnt,jdbcType=INTEGER},",
          "activity_cnt = #{activityCnt,jdbcType=INTEGER}",
        "where group_id = #{groupId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(SumerGroupExt record);
}